/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2025-09-06
 * Time: 22:36
 */
public class Test89 {
    public static void main(String[] args) {
        int[] num = {10,9,2,5,3,7,101,18};
        int ret = lengthOfLIS(num);
        System.out.println(ret);
    }
    public static int lengthOfLIS(int[] nums) {
        int n = nums.length;
        int[] dp = new int[n];
        for(int i = 0; i < n; i++) {
            dp[i] = 1;
        }
        int ret = 1;
        for(int i = 0; i < n; i++) {
            for(int j = i-1; j >= 0; j--) {
                if(nums[j] < nums[i]) {
                    dp[i] = Math.max(dp[i],dp[j]+1);
                }
            }
            ret = Math.max(dp[i],ret);
        }
        return ret;
    }
}
